package cn.iune.erp.inventory;

import java.math.BigDecimal;
import java.text.ParseException;
import java.util.List;
import com.alibaba.fastjson.JSONObject;

import cn.iune.common.base.IBizDataIface;

public interface IStorageRecordService extends IBizDataIface {

	List<StorageRecord> getAll();

	StorageRecord getByID(String fID);

	void delete(String fID);

	StorageRecord getByNo(String recordNo, String enterpriseNo);
	
	StorageRecord getByOriginNo(String origin, String originNo, String enterpriseNo);

	JSONObject save(JSONObject object) throws Throwable;

	int confirm(String fID);

	int active(String fID);

	int close(String fID);

	int open(String fID);

	int unAgree(String fID);

	//更新明细表最大流水号
	int updateMaxDetailNo(String fID, int maxDetailNo);

	/*
	//更新正在开票数量
	int updateInvoiceItemQuantityIng(String fID, BigDecimal invoiceQuantity);

	//更新开票数量
	int updateInvoiceItemQuantity(String fID, BigDecimal invoiceQuantity, BigDecimal invoiceAmount);

	//更新正在暂估数量
	int updateEvaluateItemQuantityIng(String fID, BigDecimal evaluateQuantity);

	//更新暂估数量
	int updateEvaluateItemQuantity(String fID, BigDecimal evaluateQuantity, BigDecimal evaluateAmount);

	//更新正在退货数量
	int updateBackItemQuantityIng(String fID, BigDecimal itemQuantity);

	//更新退货数量
	int updateBackItemQuantity(String fID, BigDecimal itemQuantity, BigDecimal pieceQuantity);
	*/

	void insert(StorageRecord obj);

	void update(StorageRecord obj);

	int agreeIt(String fID, String cUsercode, String cUsername, String userId);

	int updateNextNo(String recordNo, String enterpriseNo, String next, String nextName, String nextNo);

	int updateAddress(JSONObject params);

	JSONObject saveDetail(JSONObject object) throws ParseException;

	JSONObject newDataDetail(JSONObject param);

	JSONObject queryDataDetail(JSONObject param);

//	int updateUnreceived(String fID);

	int calculateItemAmount(String fID);

//	int updateFinished(String fID);

	JSONObject querySimple(JSONObject param);

	JSONObject discountAmount(StorageRecord obj, BigDecimal discountAmountTotal);

	JSONObject discountAmount(String fID, BigDecimal discountAmountTotal);

	StorageRecord packing(String billType, String billTypeName, String systemCode, int flowType, String revOpay,
			int direction, int dealType, String costingCode, String autoCode, String origin, String originName,
			String billNo, String cUsercode, String cUsername, String userId, String enterpriseNo,
			String enterpriseName);





}